﻿using IdentityService.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IdentityService.Infrastructure
{
    public interface IUserManager
    {
        Task<User?> FindByIdAsync(long userId);//根据Id获取用户
        Task<User?> FindByNameAsync(string userName);//根据用户名获取用户
        Task<User?> FindByPhoneNumberAsync(string phoneNum);//根据手机号获取用户
        Task<bool> CreateAsync(User user);//创建用户

        Task<bool> AccessFailedAsync(User user);//异步记录一次登陆失败
      //  Task<bool> VerifyPasswordAsync(User user, string password);//校验密码
        Task<bool> CheckPasswordAsync(User user, string password);//校验密码

        bool CheckPassword(User user, string password);//校验密码
        (bool, int) IsLockedOut(User user);//是否锁定
        (bool, int) AccessFailed(User user);//记录一次登陆失败
    }
}
